<?php

class AclUtil {
	
	public static function getAcoParentAlias($controller, $acoParent=null) {
		if (empty($acoParent)) {
			return null;
		}
		$parentAlias = $controller->Acl->Aco->find('first', array('fields'=> 'Aco.alias, Aco.parent_id', 'conditions'=>array('Aco.id ='=>$acoParent),'recursive'=>0));
		if(empty($parentAlias["Aco"]["parent_id"])) {
			return $parentAlias["Aco"]["alias"]; 
		} else {
			return AclUtil::getAcoParentAlias($controller, $parentAlias["Aco"]["parent_id"])."/".$parentAlias["Aco"]["alias"];
		}
	}

	

}

?>